<template>
  <div class="form-page-group">
    <div v-if="props.title" class="form-page-group-header">
      <div class="form-page-group-title">
        {{ props.title }}
      </div>
    </div>
    <div v-else style="height: 18px;"></div>
    <div class="form-page-group-body">
      <ElRow class="form-page-group-row" :gutter="20">
        <slot :data="props.data" />
      </ElRow>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ElRow } from 'element-plus'
interface Props {
  title: string,
  data: object
}
const props = withDefaults(defineProps<Props>(), {
  title: '',
  data: () => ({})
})
</script>

<style lang="scss">
.form-page-group {
  background: var(--el-color-white);
  &-header {
    height: 34px;
    display: flex;
    align-items: center;
  }
  &-title {
    height: 34px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: #FFFFFF;
    font-family: PingFangSC-Medium;
    font-weight: 500;
    font-size: 13px;
    color: #757575;
    &::before {
      box-sizing: border-box;
      content: '';
      display: inline-block;
      width: 7px;
      height: 10px;
      border: 2.4px solid #3778FB;
      border-radius: 2px;
      margin-right: 5px;
    }
  }
  &-body {
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
  }
  &-row {
    width: 100%;
  }
}
</style>
